<?php
header('Content-Type:text/html;Charset=UTF-8');
session_start();

if(isset($_SESSION['user'])){

}else {
	die('<h3>登录信息不完整</h3><a href="/index.php">返回重新登录</a>');
};


@$id = $_REQUEST['id'];

require 'lib/db.php';

$entry = dbSelect('select id,name,price,imgUrl,stock from entry where id=:id',array('id'=>$id));

@$orders = dbSelect('select id,name from orders');

?>
<!DOCTYPE html>
<html>
   <head>
      <title>SuperMarket</title>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8" >
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="nivo/nivo-slider.css" rel="stylesheet">
      <link href="themes/bar/bar.css" rel="stylesheet">
      <link href="themes/dark/dark.css" rel="stylesheet">
      <link href="themes/default/default.css" rel="stylesheet">
       <link href="themes/light/light.css" rel="stylesheet">
      <script src="bootstrap/js/jquery-1.11.1.min.js"></script>
      <script src="bootstrap/js/bootstrap.min.js"></script>
      <script src="nivo/jquery.nivo.slider.pack.js"></script>
      <!--[if lt IE 9]>
         <script src="js/html5shiv.js"></script>
         <script src="js/respond.min.js"></script>
      <![endif]-->
   </head>
<script>

</script>
   <style>
    #a{color:#62b0ff;}
    .title{height:4px;width:1135px;background:#000000;}
    .page{height:50px;width:1135px;}
    .homepage{background:black;text-align: center;height:35px}
    #font{font-size: 25px;color:white}
    .interval{width:6px;height:35px}
   .picture{border:solid 0px;height:400px;margin:20px;}
   .data{border:solid 0px;height:400px;width: 500px;margin:20px;background:#ebebeb;}
   .money{height:40px;background:#dbdbdb;}
   .Money{height:40px;background:#dbdbdb;font-size:25px;color:black}
   .moneys{font-size: 18px;color:gray;margin:10px;}
   #span{color:red;font-size: 25px;width:120px;margin:6px}
   .span{width:120px;}
   #divs{width:60px;margin:6px;height:17px;background:url(img/time.png);}
   .quantity{height:100px}
   .quantityS{height:40px}
   .quantitys{height:40px;background:#dbdbdb;}
   .moneyss{font-size: 12px;color:Orange;margin:10px;}
   .moneyS{color:gray;margin:20px;}
   #input{width:45px;height:30px}
   .inputs{margin: 10px}
   .but{height:140px;text-align:center}
   .btn{margin:70px;color:white;background:#fe5a5a;}
   .advertisement{height:150px;width:915px;float:left;}
   .fen{height:7px;border-radius:10px;background:#fe5a5a;}
   .advertise{width: 200px;height:600px;float: left;text-align:center;}
   .P{height: 150px}
   .t{height:60px}
   </style>
   <body>
   <div class="navbar navbar-default">
  <div class="container">
  	<a class="navbar-brand glyphicon glyphicon-shopping-cart" href="First.php" id="a">宜家超市</a>
  		<ul class="nav navbar-nav">
  			<li class="dropdown">
  				<a href="#" class="dropdown-toggle" data-toggle="dropdown" >档案管理 <span class="caret"></span></a>
  					<ul class="dropdown-menu">
  					<li><a href="manager.php">职工列表</a></li>
  					<li><a href="member.php">管理员</a></li>
  					</ul>
  			</li>
  		  </ul>
		<ul class="nav navbar-nav">
			<li class="dropdown">
			 <a href="#" class="dropdown-toggle" data-toggle="dropdown" >商品管理 <span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="Addmerchandise.php">商品进货</a></li>
					<li><a href="merchandiseDish.php">商品列表</a></li>
				</ul>
			</li>
		  </ul>
		<ul class="nav navbar-nav">
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown" >营业管理 <span class="caret"></span></a>
					<ul class="dropdown-menu">
						<li><a href="#">支出明细</a></li>
						<li><a href="income.php">收入明细</a></li>
					</ul>
				</li>
			</ul>
			<ul class="nav navbar-nav">
			<li class="dropdown">
			 <a href="#" class="dropdown-toggle" data-toggle="dropdown" >我的购物车 <span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="Adddesk.php">我的商品</a></li>
					<li><a href="#">消费记录</a></li>
					<li><a href="#">我的收藏</a></li>
				</ul>
			</li>
		  </ul>
			<ul class="nav navbar-nav">
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown" >权限管理 <span class="caret"></span></a>
					<ul class="dropdown-menu">
						<li><a href="#">我的权限</a></li>
						<li><a href="#">关于超市</a></li>
					</ul>
				</li>
			</ul>
	 	 <ul class="nav navbar-nav">
	  		<li class="dropdown">
	  		<a href="#" class="dropdown-toggle" data-toggle="dropdown" >登录管理 <span class="caret"></span></a>
	  				<ul class="dropdown-menu">
				  		<li><a href="#"  data-toggle="modal" data-target="#2">退出登录</a></li>
	  				</ul>
		</li>
	</ul>
 </div>
</div>
<div id="2" class="modal">
				<div class="modal-dialog">				
				<div class="modal-content">
						<div class="modal-header">
							<span class="close" data-dismiss="modal">&times;</span>
							  <div class="modal-title">
								<h4>确定退出登录</h4>
							  </div>
								</div>
						<div class="modal-body">
							你确定要退出登录吗？
						</div>
						<div class="modal-footer">
						 <a type="submit" class="btn btn-default" href="logout.php">确定</a>
						 <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						</div>
					</div>
				</div>
			</div>
  	<div class="container">
  		<div class="row">
  			<div class="col-xs-12 title"></div>
  			<div class="col-xs-12 page">
  			
  				<div class="col-xs-2 homepage">
  					<a id="font" href="First.php">首　页</a>
  				</div>
  				<div class="col-xs-1 interval" ></div>
  				<div class="col-xs-2 homepage">
  					<a id="font" href="First.php">今日鲜</a>
  				</div>
  				<div class="col-xs-1 interval"></div>
  				<div class="col-xs-2 homepage">
  					<a id="font" href="First.php">大包装</a>
  				</div>
  			</div>
			  <div class="col-xs-4 picture">
			  <div class="thumbnail" style="height: 398px">
			  	<img src="img/<?php echo $entry['imgUrl']; ?>" />
			  </div>
			  <div class="advertisement">
			  	<div class="col-xs-12 t"></div>
			  	<img src="img/23.png">
			  </div>
			  </div>
			  
			  <div class="col-xs-8 data">
			  	<div class="col-xs-12 Money">
			  		【<?php echo $entry['name']; ?>】
			  	</div>
			  	<div class="col-xs-12 money">
			  		<div class="col-xs-2 moneys">
			  			价格
			  		</div>
			  		<div class="col-xs-4 span">
			  			<div id="span">￥<?php echo $entry['price']; ?></div>
			  		</div>
				  	<div class="col-xs-4 span">
				  			<div id="divs"></div>
				  	</div>
			  	</div>
			  	<div class="col-xs-12 quantitys">
			  		<div class="col-xs-5 moneys">
			  			本店活动
			  		</div>
			  		<div class="col-xs-5 moneyss">
			  			满两件包邮
			  		</div>
			  	</div>
			  	<div class="col-xs-12 quantityS">
			  	</div>
			  	<div class="col-xs-12 quantity">
			  		<div class="col-xs-2 moneyS">
			  			数量
			  		</div>
			  		<div class="col-xs-7 moneyS">
					<input name="stock" type="number" min="1" class="form-control" value="1" title="请输入购买量">
			  		限购10件
			  		</div>
			  		<div class="col-xs-12 inputs">
			  			库存[<?php echo $entry['stock']; ?>]件
			  		</div>
			  	</div>
			  	<div class="col-xs-12 but">
			  		<a href="Adddesk.php?entryId=<?php echo $entry['id']; ?>&&ordersId=<?php echo $orders['id'];  ?>" class="btn btn-default">添加至超市购物车</a>
			  	</div>
				  
			  </div>
			  <div class="advertise">
			  	<img src="img/15.png" title="赶快登录有礼"/>
			  	<img src="img/14.png" />
			  	<img src="img/13.png" />
			  </div>
  		</div>
  		
  		<div class="col-xs-12 fen"></div>
  	</div>
  	<script>
	   	$('.nivoSlider').nivoSlider({
	   		directionNav:true,
	   		pauseOnHover:true,
	   		controlNav:false,
	   		effect:'fade',
	   	});
  	</script>

   </body>
</html>

